var express = require('express');
var router = express.Router();
var db = require('../db/index')

/* GET users listing. */
router.get('/', function(req, res) {

  const sql = "select * from majors where isdelete = 0";
  db.query(sql, (err, result) => {
    if (err) return res.show(err);
    if (result.length === 0) return res.show("专业信息查询失败！");
    // console.log(result)
    res.render("pages/edit", { majorData: result });
  });

});

module.exports = router;
